package com.real8.plusplayground.client.person;

import com.google.api.gwt.services.plus.shared.model.PersonOrganizations;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class PersonOrganizationViewer extends Composite implements
		PersonOrganizationView {
	interface Driver
			extends
			SimpleBeanEditorDriver<PersonOrganizations, PersonOrganizationViewer> {
	}

	private static PersonOrganizationViewerUiBinder uiBinder = GWT
			.create(PersonOrganizationViewerUiBinder.class);

	interface PersonOrganizationViewerUiBinder extends
			UiBinder<Widget, PersonOrganizationViewer> {
	}

	private final Driver driver = GWT.create(Driver.class);

	@UiField
	Label titleEditor;

	@UiField
	Label nameEditor;

	@UiField
	SpanElement startDateEditor;

	@UiField
	SpanElement endDateEditor;

	// TODO handle boolean type
	// @UiField
	// Label primaryEditor;

	@UiField
	Label descriptionEditor;

	@UiField
	Label locationEditor;

	@UiField
	Label typeEditor;

	public PersonOrganizationViewer() {
		initWidget(uiBinder.createAndBindUi(this));
		driver.initialize(this);
	}

	@Override
	public SimpleBeanEditorDriver<PersonOrganizations, ?> getEditorDriver() {
		return driver;
	}
}
